package com.whfc.iot.fse.lift.codec;

import com.whfc.iot.fse.lift.entity.LiftConst;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author sun_guodong
 * @description
 * @date 2021-05-28
 */
public class LiftMsgDataDecoderFactory {
    private static Logger logger = LoggerFactory.getLogger(LiftMsgDataDecoderFactory.class);

    private static LiftMsgDataCodec0x10 liftMsgDataCodec0x10 = new LiftMsgDataCodec0x10();
    private static LiftMsgDataCodec0x13 liftMsgDataCodec0x13 = new LiftMsgDataCodec0x13();

    public static LiftMsgDataCodec getLiftMsgDataCodec(Integer cmd) {
        LiftMsgDataCodec bodyCodec = null;
        switch (cmd) {
            case LiftConst.LIFT_UP_CMD_0X10:
                bodyCodec = liftMsgDataCodec0x10;
                break;
            case LiftConst.LIFT_UP_CMD_0X13:
                bodyCodec = liftMsgDataCodec0x13;
                break;
            default:
                logger.info("无法解析的指令,cmd:{}", cmd);
                break;
        }
        return bodyCodec;
    }

}
